package level.editor.mediator;

import level.editor.command.Command;

/*
 * A Module is associated with each major component of the editor. Communication
 * between Modules is handled by the Mediator. Each Module will have a reference
 * to the Mediator, and each Module is capable of creating and pushing Commands
 * to the Mediator, as well as receiving Commands for execution. Each module
 * will also have a reference to it's View counterpart.
 */

public abstract class Module
{
	protected Mediator mediator;
	protected String name;
	
	public Module(Mediator mediator, String name)
	{
		this.mediator = mediator;
		this.name = name;
		mediator.add(name, this);
	}

	public void pushUpCommand(Command command)
	{
		mediator.pushUpCommand(command);
	}

	public abstract void pushDownCommand(Command command);
}
